package logic.api;

import logic.logic.AccountsLogic;

import com.google.appengine.api.users.User;
import common.datatransfer.UserType;

public class Logic {

	/**
	 * @return Returns null if the user is not logged in.
	 */
	public UserType getLoggedInUser() {
		AccountsLogic accounts = AccountsLogic.inst();
		User user = accounts.getUser();
		if (user == null) {
			return null;
		}
		UserType userType = new UserType(user.getNickname());
		return userType;
	}

}
